#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#define xnew(n,Type) (Type *)malloc(n*sizeof(Type))

char * concat(char *s1,char *s2,char *s3)
{
  int len1 = strlen(s1),len2 = strlen(s2),len3 = strlen(s3);
  char *result = xnew(len1 + len2 + len3 + 1,char);
  strcpy(result,s1);
  strcpy(result + len1,s2);
  strcpy(result + len1 + len2,s3);
  result[len1 + len2 + len3] = '\0';
  return result;
}

int main(int argc,char **argv)
{
  char *a = "This is string a";
  char *b = "This is string b";
  char *c1 = "This is string c";
  printf("%s",concat(a,b,c1));
  return 0;
}
